import request from '@/utils/request'

export function login(username, password) {
  return request({
    url: `/login?username=${username}&password=${password}`,
    method: 'post',
    data: { username, password }
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}

export function getBarCodeOrName(name) {
  return request({
    url: `/getBarCodeOrName?name=${name}`,
    method: 'get'
  })
}
